<?php
/**
 *
 *
 */
namespace Yz\modules\News;

class Controller_Default
    extends \Yz\modules\Generic\Controller_Default
{


    /**
     *
     */
    protected function doGET()
    {
        debug();

        if (static::$isAdmin) {
            return parent::doGet();
        }

        $arg = $this->fetchArgument(0);
        if ("" === (string)$arg) {
            return parent::doGet();
        }

        $model = $this->module->selectModel('Default');
        $item = $model->fetchItemByTitle($arg);

        $template = $this->selectTemplate('entry');
        $template->item = $item;
        $template->prevItem = $model->fetchPreviousItem($item);
        $template->nextItem = $model->fetchNextItem($item);
        return $this->outputTemplate($template);
    }

}
